package client.behavioral.responsibility_chain.ext;

import org.junit.Test;
import uml.behavioral.responsibility_chain.ext.*;

/**
 * 职责链--客户端
 * on 2023/2/1 14:51
 */
public class Client {
    @Test
    public void t() {
        HandlerChain handlerChain = new HandlerChain(
                new Handler[]{new PriceHandler(), new StockHandler(), new QualityHandler(), new PassedHandler()});
        Result result = handlerChain.handleRequest(
                new Request(19, 40, 98),
                new Standard(20, 30, 97,
                        "单品价格定价过高", "商品库存太低", "商品质量不合格"));
        System.out.println(result);
    }
}
